import { AxiosPromise } from 'axios'
// @ts-ignore
import request from '/@/utils/request'

const prefix = '/api/dms/order/'
// 获取列表
export const orderList: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}list`, { data })

// 新建保存 insert
export const orderInsert: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}insert`, { data })
// 获取详情
export const orderInfo: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}info`, { data })
// 订单取消
export const orderCancel: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}cancel`, { data })
//订单号筛选  options
export const orderOptions: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}options`, { data })
// 订单删除
export const orderDelete: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}delete`, { data })

// 折扣详情
export const orderDiscountInfo: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}discount/info`, { data })
// 新增折扣
export const orderDiscountInsert: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}discount/insert`, { data })
// 更新折扣策略
export const orderDiscountUpdate: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}discount/update`, { data })
// 折扣策略列表
export const orderDiscountList: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}discount/list`, { data })
// 列表选项 策略名称+创建人
export const orderDiscountOptions: () => AxiosPromise = () =>
  request(`${prefix}discount/options`)
// 订单匹配折扣
export const orderMatch: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}discount/match`, { data })
// 列表的撤销和停用
export const orderDiscountBatch: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}discount/batch`, { data })
// 订单查询导出
export const orderExport: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}export`, { data })
// 出库单的下拉选项
export const orderStockOutOptions: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}stockOut/options`, { data })
// 出库单的下拉选项
export const orderAuditLine: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}audit_line`, { data })
// 寄售结算单 取消审批  cancelApproval
export const orderCancelApproval: (data: object) => AxiosPromise = (data) =>
  request(`${prefix}cancelApproval`, { data })
